package T16;

import java.util.Scanner;

public class Test16 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入一个QQ号：");
        String qqNumber = scanner.nextLine();

        // 定义正则表达(刚刚从bilibili上看到)
        String regex = "^[1-9]\\d{4,14}$";
        if (qqNumber.matches(regex)) {
            System.out.println(qqNumber + "：是一个有效的QQ号");
        } else {
            System.out.println(qqNumber + "：不是一个有效的QQ号");
        }

        scanner.close();
    }
}
